#ifndef HB_POOL_H
#define HB_POOL_H

#include "layer_base.h"

class pool_layer_t: public layer_t
{
public:
	uint16_t stride;
	uint16_t extend_filter;

	pool_layer_t( uint16_t stride_, uint16_t extend_filter_, tdsize in_size );

	point_t map_to_input( point_t out, int z );

	struct range_t
	{
		int min_x, min_y, min_z;
		int max_x, max_y, max_z;
	};

	int GET_R( float f, int max, bool lim_min );

	range_t map_to_output( int x, int y );

	void activate( tensor_t<float>& in ) override;

	void fix_weights() override;

	void calc_grads( tensor_t<float>& grad_next_layer ) override;
};


#endif //HB_POOL_H